import React, {Component} from "react";
import shareMaskScss from "../sass/shareMask.scss";


export default class ShareMask extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        const maskStyle = {
            backgroundImage: "url(" + this.props.shareMaskImg + ")"
        };
        let maskJsx = this.props.show ? (
            <div
                className={shareMaskScss.shareMask}
                style={maskStyle}
                onTouchEnd={this.props.closeFun}
                onTouchStart={this.stopTouchEvent}
            />
        ) : null;
        return <span>{maskJsx}</span>;
    }

    stopTouchEvent(event) {
        event.preventDefault();
    }
}
